package com.thb.pay.api.merchant;


import com.thb.pay.api.merchant.fallback.MchAccountServiceApiFallbackFactory;
import com.thb.pay.api.merchant.vo.req.MchAccountPageReq;
import com.thb.pay.api.merchant.vo.req.MchAccountReq;
import com.thb.pay.api.merchant.vo.resp.MchAccountVo;
import com.thb.pay.core.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(value = "pay-service", fallbackFactory = MchAccountServiceApiFallbackFactory.class)
@RequestMapping("/mchAccountServiceApi")
public interface MchAccountServiceApi {

    @RequestMapping(value = "/findPage", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    PageResult<MchAccountVo> findPage(@RequestBody MchAccountPageReq pageReq);

    @RequestMapping(value = "/getById", method = RequestMethod.GET)
    MchAccountVo getById(@RequestParam("id") Long id);

    @RequestMapping(value = "/add", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void add(@RequestBody MchAccountReq mchAccountReq);

    @RequestMapping(value = "/update", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void update(@RequestBody MchAccountReq mchAccountReq);

}
